{% extends 'base.html'%}{% load staticfiles %}
{% block style %}
<style type="text/css">
   h2,div{
        text-align: center;
    }
    .textleft{
    	text-align: left;
    }
    leavebottom{
    	margin-bottom: 20px;
    }
</style>
{% endblock %}



{% block title %}{{pageData.title}}{% endblock %}
{% block content %}
<div class="page-header">
	<h2>{{pageData.header}}</h2>
</div>
<br>
<div class="row leavebottom">
 	{% for v in pageData.novellisttitle %}
 		{% if forloop.counter0|divisibleby:4 %}
 			<div class="row">
 		{% endif %}
 		<span class="col-md-3 textleft">{{v}}</span>	
 		{% if forloop.counter0|divisibleby:4 %}
 			</div>
 		{% endif %}
    {% endfor %}
    
	
</div>
{% endblock %}

{% block script %}
	<script type="text/javascript">
		function formatNum(num){
			if(num<10){
		  		return '00'+num;
			}else if(num<100){
			 	return '0'+num;
			}else{
			 	return num;
			}
		}

		$(function(){
		    var num={{pageData.pageCos}}
		    $('li.contentlist').eq(num).addClass('active')
		    var path = "{% static 'imgs/pic1.jpg' %}"
		    for(var i=1;i<9;i++){
		    	$('.portraits').eq(i-1).attr('src',path)
		    	path = "{% static 'imgs/pic1.jpg' %}"
		    }
			$('li.contentlist').click(function(){
		        $(this).addClass('active');
		        $('.contentlist').not($(this)).removeClass('active');
			})
		})
	</script>
{% endblock %}